#include "CTimeTrigger.h"

bool CTimeTrigger::check()
{
	u32 delta = device->getTimer()->getTime() - lastTime;
			
	if(delta >= ms)
	{
		lastTime = device->getTimer()->getTime();
		return true;
	}
	return false;
}

CTimeTrigger::CTimeTrigger(u32 ms, IrrlichtDevice* device)
{
	this->ms = ms;
	this->device = device;
		
	lastTime = device->getTimer()->getTime();
}